package com.sense.kukoo.biz_media.adapter.provider

import com.sense.kukoo.biz_media.R
import com.sense.kukoo.biz_media.adapter.CommentContentAdapter
import com.sense.kukoo.common.repo.biz.CommentContentBean
import com.sense.kukoo.common.repo.http.bean.CommentRecordBean
import com.sense.kukoo.common.wiget.adapter.provider.MultiItemProvider
import com.sense.kukoo.common.wiget.adapter.viewholder.BaseViewHolder

class CommentEnd2HideItemProvider(val listener: CommentContentAdapter.CommentListener): MultiItemProvider<CommentContentBean>() {

    override fun getItemType(): Int = CommentContentBean.TYPE_COMMENT_END_TO_HIDE

    override fun getItemLayoutId(): Int = R.layout.biz_media_item_comment_2_hide

    override fun onBindViewHolder(viewHolder: BaseViewHolder, item: CommentContentBean) {
        val data: CommentRecordBean = item.data!!
        //
        val cl_comment_root = viewHolder.getView(R.id.cl_comment_root)
        cl_comment_root.setOnClickListener {
            listener.onHideComment(data)
        }
    }
}